import { Component } from 'react'
import {View, Text } from '@tarojs/components'
import './index.scss'

export default class LgBadge extends Component {
  state = {}

  componentDidMount () {}

  componentDidShow () {}

  componentDidHide () {}

  componentDidCatchError () {}

  render () { 
    var props = this.props; 
    var className = props.className || "", style = props.style || {}, type = props.type || "A";
    className +=" lg_badge_" + type;
    if (props.color) className += " lg_badge_color_" + type + props.color;
    if (type == "C") {
      var subContent = <View className=" lg_badge_sub">{this.props.children}</View>
    } else if (type == "D") {
      var subContent = <View className=" lg_badge_sub_warp">
                          <View className="lg_badge_d_line"><View className="lg_badge_d_top"/></View>
                          <View className=" lg_badge_d_sub">{this.props.children}</View>
                          <View className="lg_badge_d_line"><View className="lg_badge_d_bottom" /></View>
                      </View>
    } else {
      var subContent = this.props.children;
    }
    return (
      <View className={className} style = {style}>{subContent}</View>
    )
  }
}